﻿using DocumentFormat.OpenXml.Lite.DrawingML.Types;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.DrawingML.Geometry
{
    [XmlRoot("pathLst", Namespace = Constants.Main)]
    public class ShapePaths : XmlSerializable
    {
        [Optional]
        [XmlElement("path", Namespace = Constants.Main)]
        public XmlList<Path> Paths { get; set; }

        public ShapePaths()
        {
            Paths = new XmlList<Path>();
        }
    }

    [XmlRoot("path", Namespace = Constants.Main)]
    public class Path : XmlSerializable
    {
        [Optional]
        [XmlAttribute("w", Form = XmlSchemaForm.Qualified)]
        public Nullable<long> PathWidth { get; set; }

        [Optional]
        [XmlAttribute("h", Form = XmlSchemaForm.Qualified)]
        public Nullable<long> PathHeight { get; set; }

        [Optional]
        [XmlAttribute("fill", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_PathFillMode> PathFill { get; set; }

        [Optional]
        [XmlAttribute("stroke", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> PathStroke { get; set; }

        [Optional]
        [XmlAttribute("extrusionOk", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> Extrusion3dAllowed { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Main)]
        public XmlList<IPathElement> Elements { get; set; }

        public Path() 
        {
            Elements = new XmlList<IPathElement>();
        }
    }
}
